//
//  DKHomeUnauthorizeHeadView.m
//  DanKU
//
//  Created by 吴斌 on 2023/9/26.
//

#import "DKHomeUnauthorizeHeadView.h"
#import "DKHomeStepView.h"
@implementation DKHomeUnauthorizeHeadView
-(instancetype)init{
    if(self == [super init]){
        [self dk_addSubView];
    }
    return self;
}
- (void)dk_addSubView{
    UIImageView* dk_HomeBgImgView = [[UIImageView alloc] init];
    dk_HomeBgImgView.userInteractionEnabled = YES;
    dk_HomeBgImgView.image = DK_GetImage(@"dk_HomeUnauthorizeHeadBg");
    [self addSubview:dk_HomeBgImgView];
    [dk_HomeBgImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self);
    }];
    //welcome
    UILabel *dk_welcomeLab = [[UILabel alloc] init];
    dk_welcomeLab.textColor = DK_Hex(@"#FFFFFF");
    dk_welcomeLab.font = DK_FONT_Semibold(30);
    dk_welcomeLab.text = @"Welcome！";
    [self addSubview:dk_welcomeLab];
    [dk_welcomeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(DK_IsWidthScale(30)));
        make.top.equalTo(@(DK_IsWidthScale(49)+DK_SafeAreaTop));
        make.height.equalTo(@(DK_IsWidthScale(42)));
    }];
    UILabel *dk_welcomeAlertLab = [[UILabel alloc] init];
    dk_welcomeAlertLab.textColor = DK_Hex(@"#FFFFFF");
    dk_welcomeAlertLab.font = DK_FONT_Regular(14);
    dk_welcomeAlertLab.text = @"Get a Fast Personal Loan in Just 3 Steps！";
    [self addSubview:dk_welcomeAlertLab];
    [dk_welcomeAlertLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(DK_IsWidthScale(30)));
        make.top.equalTo(dk_welcomeLab.mas_bottom).offset(DK_IsWidthScale(10));
        make.height.equalTo(@(DK_IsWidthScale(20)));
    }];
    
    CGFloat dk_homeStepW = (DK_SCREEN_W - DK_IsWidthScale(66))/3;
    //submit info
    DKHomeStepView * dk_HomeSubmitInfoView = [[DKHomeStepView alloc] init];
    dk_HomeSubmitInfoView.stepName = @"Submit info";
    dk_HomeSubmitInfoView.imageName = @"dk_HomeUnauthorizeSubmitInfoIcon";
    [self addSubview:dk_HomeSubmitInfoView];
    [dk_HomeSubmitInfoView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(DK_IsWidthScale(15)));
        make.top.equalTo(dk_welcomeAlertLab.mas_bottom).offset(DK_IsWidthScale(20));
        make.height.equalTo(@(DK_IsWidthScale(75)));
        make.width.equalTo(@(dk_homeStepW));
    }];
    UIImageView* dk_SubmitInfoCenterView = [[UIImageView alloc] init];
    dk_SubmitInfoCenterView.userInteractionEnabled = YES;
    dk_SubmitInfoCenterView.image = DK_GetImage(@"dk_HomeUnauthorizeHeadNextIcon");
    [self addSubview:dk_SubmitInfoCenterView];
    [dk_SubmitInfoCenterView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(dk_HomeSubmitInfoView.mas_right);
        make.top.equalTo(dk_HomeSubmitInfoView).offset(DK_IsWidthScale(15));
        make.width.equalTo(@(DK_IsWidthScale(18)));
        make.height.equalTo(@(DK_IsWidthScale(14)));
    }];
    //get limit
    DKHomeStepView * dk_HomeGetLimitView = [[DKHomeStepView alloc] init];
    dk_HomeGetLimitView.stepName = @"Get limit";
    dk_HomeGetLimitView.imageName = @"dk_HomeUnauthorizeGetLimitIcon";
    [self addSubview:dk_HomeGetLimitView];
    [dk_HomeGetLimitView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(dk_SubmitInfoCenterView.mas_right);
        make.top.equalTo(dk_HomeSubmitInfoView);
        make.height.equalTo(dk_HomeSubmitInfoView);
        make.width.equalTo(@(dk_homeStepW));
    }];
    UIImageView* dk_GetLimitCenterView = [[UIImageView alloc] init];
    dk_GetLimitCenterView.userInteractionEnabled = YES;
    dk_GetLimitCenterView.image = DK_GetImage(@"dk_HomeUnauthorizeHeadNextIcon");
    [self addSubview:dk_GetLimitCenterView];
    [dk_GetLimitCenterView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(dk_HomeGetLimitView.mas_right);
        make.top.equalTo(dk_SubmitInfoCenterView);
        make.width.equalTo(@(DK_IsWidthScale(18)));
        make.height.equalTo(@(DK_IsWidthScale(14)));
    }];
    //apply loans
    DKHomeStepView * dk_HomeApplyLoansView = [[DKHomeStepView alloc] init];
    dk_HomeApplyLoansView.stepName = @"Apply loans";
    dk_HomeApplyLoansView.imageName = @"dk_HomeUnauthorizeApplyLoansIcon";
    [self addSubview:dk_HomeApplyLoansView];
    [dk_HomeApplyLoansView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(dk_GetLimitCenterView.mas_right);
        make.top.equalTo(dk_HomeSubmitInfoView);
        make.height.equalTo(dk_HomeSubmitInfoView);
        make.width.equalTo(@(dk_homeStepW));
    }];
}
@end
